-
Notifications
You must be signed in to change notification settings - Fork 25
feat: enable arbitrary json in the ingest apis #3047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable arbitrary json in the ingest apis #3047
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables IngestApi and Stream resources to accept payloads with arbitrary additional fields beyond their defined schema using TypeScript index signatures and Python's extra='allow' configuration. The API validates known fields while gracefully accepting extra fields without validation errors.
Key Changes:
- Modified the TypeScript compiler to allow index signatures for IngestApi and Stream types while extracting only named properties as columns
- Added comprehensive test coverage including templates, transforms, and E2E tests
- Updated documentation for both TypeScript and Python implementations
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ts-moose-lib/src/dataModels/typeConvert.ts | Added ToColumnsOptions interface with allowIndexSignatures flag to conditionally permit index signatures |
| packages/ts-moose-lib/src/dmv2/dataModelMetadata.ts | Enabled allowIndexSignatures for IngestApi and Stream resource types |
| templates/typescript-tests/src/ingest/indexSignatureTests.ts | Created test types and resources demonstrating index signature usage with IngestApi |
| templates/typescript-tests/src/ingest/transforms.ts | Added transform mapping UserEventInput to UserEventOutput with logging |
| apps/framework-cli-e2e/test/utils/schema-definitions.ts | Added expected schema for UserEventOutput table |
| apps/framework-cli-e2e/test/templates.test.ts | Added E2E test validating ingestion and transform of payloads with extra fields |
| apps/framework-docs/src/pages/moose/apis/ingest-api.mdx | Added "Accepting Arbitrary Fields" documentation section |
| apps/framework-docs-v2/content/moosestack/apis/ingest-api.mdx | Added "Accepting Arbitrary Fields" documentation section |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
908fa3a to
92b829a
Compare
9671ea5 to
7b4b6f9
Compare
f56269b to
c7213e0
Compare
Note
Adds end-to-end support for accepting arbitrary JSON fields in IngestApi/Stream (TS index signatures, Python extra='allow') and passing them through to streaming functions, with validation, infra wiring, tests, and docs.
IngestApi,Stream, andIngestPipeline(whentable=false); injectallowExtraFieldsthroughTypedBase,Stream,IngestApi, andIngestPipeline.dict[str, Any]andAnyasJSON; detect Pydanticextra='allow'and emitallow_extra_fieldsin infra map.allow_extra_fieldstoDataModeland ingest API wiring; enhanceDataModelVisitorwith pass-through for extra fields using streamingPassThroughSeed; route to Kafka unchanged.allow_extra_fieldsfrom partial -> full map for ingress APIs.toColumnsoption to allow index signatures; blockIngestPipelinewith table+index signatures; propagate flag into constructors.UserEventOutput.properties.local.UserEventOutput(TS/PY variants).extra='allow'), with transform examples.Written by Cursor Bugbot for commit 40393f0. This will update automatically on new commits. Configure here.